package com.ruoyi.user.service.impl;

import com.ruoyi.common.utils.DateUtils;

import com.ruoyi.user.domain.FamilyUserRelation1;
import com.ruoyi.user.mapper.FamilyUserRelation1Mapper;
import com.ruoyi.user.service.IFamilyUserRelation1Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户和家庭关联Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-20
 */
@Service
public class FamilyUserRelation1ServiceImpl implements IFamilyUserRelation1Service
{
    @Autowired
    private FamilyUserRelation1Mapper familyUserRelation1Mapper;

    /**
     * 查询用户和家庭关联
     * 
     * @param id 用户和家庭关联主键
     * @return 用户和家庭关联
     */
    @Override
    public FamilyUserRelation1 selectFamilyUserRelationById(Long id)
    {
        return familyUserRelation1Mapper.selectFamilyUserRelationById(id);
    }

    /**
     * 查询用户和家庭关联列表
     * 
     * @param familyUserRelation1 用户和家庭关联
     * @return 用户和家庭关联
     */
    @Override
    public List<FamilyUserRelation1> selectFamilyUserRelationList(FamilyUserRelation1 familyUserRelation1)
    {
        return familyUserRelation1Mapper.selectFamilyUserRelationList(familyUserRelation1);
    }

    /**
     * 新增用户和家庭关联
     * 
     * @param familyUserRelation1 用户和家庭关联
     * @return 结果
     */
    @Override
    public int insertFamilyUserRelation(FamilyUserRelation1 familyUserRelation1)
    {
        familyUserRelation1.setCreateTime(DateUtils.getNowDate());
        return familyUserRelation1Mapper.insertFamilyUserRelation(familyUserRelation1);
    }

    /**
     * 修改用户和家庭关联
     * 
     * @param familyUserRelation1 用户和家庭关联
     * @return 结果
     */
    @Override
    public int updateFamilyUserRelation(FamilyUserRelation1 familyUserRelation1)
    {
        return familyUserRelation1Mapper.updateFamilyUserRelation(familyUserRelation1);
    }

    /**
     * 批量删除用户和家庭关联
     * 
     * @param ids 需要删除的用户和家庭关联主键
     * @return 结果
     */
    @Override
    public int deleteFamilyUserRelationByIds(Long[] ids)
    {
        return familyUserRelation1Mapper.deleteFamilyUserRelationByIds(ids);
    }

    /**
     * 删除用户和家庭关联信息
     * 
     * @param id 用户和家庭关联主键
     * @return 结果
     */
    @Override
    public int deleteFamilyUserRelationById(Long id)
    {
        return familyUserRelation1Mapper.deleteFamilyUserRelationById(id);
    }
}
